<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('工作记录')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <input type="hidden" name="workType" th:value="${workType}"/>
                    <ul>
                        <li>
                            核验人：<input type="text" name="checkUser"/>
                        </li>

                        <li>
                            工作名称：<input type="text" name="nWorckName"/>
                        </li>

                        <li class="select-time">
                            <label>日期： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endTime]"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()"
               shiro:hasPermission="system:ncNormalWorks:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncNormalWorks:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncNormalWorks:remove')}]];
    var prefix = ctx + "system/ncNormalWorks";

    var workType = [[${workType}]];
    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add?workType=" + workType,
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "农事记录",
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            showExport: false
            ,
            columns: [{
                checkbox: false
            },{
                title: "序号",
                formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            },
                {
                    field: 'nWorkId',
                    title: '工作记录id',
                    visible: false
                },
                {
                    field: 'nWorckName',
                    title: '工作名称',
                    sortable: true
                },
                {
                    field: 'content',
                    title: '工作内容',
                    sortable: true
                },
                {
                    field: 'workers',
                    title: '参与人员',
                    sortable: true
                },
                {
                    field: 'checkUser',
                    title: '核验人',
                    sortable: true
                },
                {
                    field: 'timeLength',
                    title: '工作时长',
                    sortable: true
                },
                {
                    field: 'createTime',
                    title: '日期',
                    sortable: true
                },
                {
                    field: 'remark',
                    title: '备注',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                }]
        };
        $.table.init(options);
    });
    setTitle("工作记录",false);
</script>
</body>
</html>